clear
close all
clc
delete *.asv

cd ..\
cd Stored_File

load Debt_policy_2state

nb=length(debt);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%% FIGURE 4 %%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

subplot(2,2,1)
hb1=bar(debt,probb1,20),hold on;
hb2=bar(debt,probb2,20),hold on;
hb1.FaceColor = '[0.5 0.5 0.5]';
hb2.FaceColor = '[0 0 0]';
set(gca, 'Xtick', [0 0.1 0.2 0.3], 'Ytick', [.0625 .125 .25], 'box', 'off')
xlim([-0.002,0.3])
ylim([0,0.28])
set(gca,'FontSize',05);
xlabel('d')
text(0-0.05,0.28,'$$\phi(s,d)$$','Interpreter','Latex','FontSize',05)

MRPAgg=MRP+alpha.*MRP_fe;

subplot(2,2,2)
scatter(debt,(-(MRPAgg-MRP_fe)./MRP_fe).*100,(probb1(1:1:nb)).*500+0.000001,'filled','MarkerFaceColor',[0.5 0.5 0.5]); hold on
scatter(debt,(-(MRPAgg-MRP_fe)./MRP_fe).*100,(probb2(1:1:nb)).*500+0.000001,'filled','MarkerFaceColor',[0 0 0]); hold on
xlabel('d')
set(gca,'FontSize',05);
set(gca, 'Xtick', [0 0.1 0.2 0.3],'Ytick', [60 65 70 75], 'box', 'off')
axis([b1fb, 0.3,62,78])
text(b1fb-0.06,78,'$$\%\Delta$$MRP','Interpreter','Latex','FontSize',05)
